package com.sky.mapper;

import com.sky.entity.Dish;
import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {
    void batchSave(List<SetmealDish> setmealDishes);
    @Select("select *from setmeal_dish where setmeal_id=#{id}")
    List<SetmealDish> selectById(Long id);
    @Delete("delete from setmeal_dish where setmeal_id =#{id}")
    void deleteByCategoryId(Long id);
    @Select("select *from setmeal_dish s left join dish d on s.dish_id = d.id where s.setmeal_id=#{id} and d.status =#{stu}")
    List<Dish> selectByDishId(Long id, Integer stu);
}
